package cn.offer.controller;

import cn.offer.domain.YixuePaotuiFabu;
import cn.offer.service.PaoTuiFaBuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Snake Eyes
 * @PROJECT_NAME: paotui
 * @DESCRIPTION:
 * @USER: 11647
 * @DATE: 2021/5/24 9:27
 * @Email: 1164763541@qq.com
 */
@RestController
@RequestMapping("fabu")
public class PaoTuiFaBuController {
    @Autowired
    private PaoTuiFaBuService faBuServer;


    @GetMapping("list")
    public List<YixuePaotuiFabu> findAll(Model model) {
        List<YixuePaotuiFabu> list = faBuServer.findAll();
        model.addAttribute("list", list);
        return list;
    }
    @ResponseBody
    @PostMapping("update/{id}")
    public YixuePaotuiFabu findAll(@PathVariable Integer id) {
        YixuePaotuiFabu yixuePaotuiFabu = faBuServer.selectByPrimaryKey(id);
        System.out.println(yixuePaotuiFabu);

        return yixuePaotuiFabu;
    }
}
